﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core.Implements;
using Cofe.Core.Interfaces;
using Cofe.Core.Service;

namespace Cofe.Core
{
    public abstract class BootStrapperBase : IBootStrapper
    {
        #region Constructor
        
        #endregion

        #region Methods

        public abstract IServiceImporter ConfigureServiceImporter();

        public virtual void Run(params ICofeService[] additionalServices)
        {
            var serviceLocater = new ServiceLocater();
            var services = ConfigureServiceImporter().ImportServices();
            serviceLocater.Register(services);
            serviceLocater.Register(additionalServices);
            CofeServices.ServiceLocater = serviceLocater;

            CofeServices.Logger.Log(String.Format("BSB: Imported {0} Services", services.Count()));

           
        }

        #endregion

        #region Data
        
        #endregion

        #region Public Properties
        
        #endregion

    }
}
